package com.cloud.schedule.api.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.cloud.schedule.api.service.ScheduleGroupService;
import com.cloud.schedule.common.result.QkTreeNode;
import com.cloud.schedule.common.utils.TreeHelper;

@Service
@Transactional
public class ScheduleGroupServiceImpl implements ScheduleGroupService{
	@Autowired
	private JdbcTemplate jdbcTemplate;

	@Override
	public QkTreeNode[] list() {
		List<QkTreeNode> list = jdbcTemplate.queryForList("select * from ", QkTreeNode.class);
		return TreeHelper.buildList2Tree(list);
	}
	
}
